_[69]={
	backward:function(){
		this._K();
		if(this._p>0)
			this._o=5;
		else{
			this._d.lastChild.style.webkitTransform='translateX('+(-this._w*3/4)+'px)';
			this._F();
			this._o=3;
		}
		this._C();
	},
	forward:function(){
		this._K();
		if(this._p<this._q-1)
			this._o=4;
		else{
			this._d.lastChild.previousSibling.style.webkitTransform='translateX('+(-this._w/4)+'px)';
			this._F();
			this._o=2;
		}
		this._C();
	},
	onchange:function(x){
	},
	ondrawitem:function(x){
	},
	ondrawoverlay:function(x){
	},
	reset:function(fetch){
		if(fetch)
			this._L(1);
		else{
			var i=0,m=this._q,n=this._d.lastChild,r=this._r;
			n.style.webkitTransform='translateX('+(-this._w)+'px)';
			n.src='/img/blank.gif';
			if(m>3)
				m=3;
			while(i<m){
				n=n.previousSibling;
				n.src=r[i++]._;
			}
			this._p=0;
			this.onchange(r[0]);
		}
	},
	store:function(){
		localStorage.setItem(this._g,JSON.stringify(this._r));
	},

	_:function(d){
		d.innerHTML='<img><img><img><img>';
		this._d=d;
		this._g=d.getAttribute('storage');
		this._w=d.lastChild.clientWidth;
		var r=localStorage.getItem(this._g);
		if(r)
			this._r=JSON.parse(r);
		this._s='translateX(-'+this._w+'px)';
		this._A('click','_B');
		this._A('touchend','_E');
		this._A('touchmove','_M');
		this._A('touchstart','_S');
		this._A('transitionend','_T');
		this._L();
	},

	_b:0,		// touch base
	_d:null,	// dom node
	_g:null,	// storage
	_n:'-webkit-transform 333ms ease-out',
	_o:0,		// opt
	_p:0,		// image pointer
	_q:0,		// length of image set
	_r:[{k:0}],	// image set
	_s:null,	// trans style
	_t:0,		// time
	_w:0,		// width

	_A:function(e,f){
		var o=this;
		this._d.addEventListener(e,function(v){return o[f](v);},false);
	},
	_B:function(e){		// click
		if(e.screenX*2 > screen.width)
			this.forward()
		else this.backward()
	},
	_C:function(){		// transcont
		var c=this._d.lastChild;
		var b=c.previousSibling;
		switch(this._o){
		case 2:
			b.style.webkitTransition=this._n;
			b.style.webkitTransform=null;
			this._o=8;
			break;
		case 3:
			c.style.webkitTransition=this._n;
			c.style.webkitTransform=this._s;
			this._o=9;
			break;
		case 4:
			b.style.webkitTransition=this._n;
			b.style.webkitTransform=this._s;
			this._o=6;
			break;
		case 5:
			c.style.webkitTransition=this._n;
			c.style.webkitTransform=null;
			this._o=7;
			break;
		}
//		out('C:'+new Date().getTime()+'.'+this._o);
	},
	_E:function(e){		// touchend
		this._t=new Date().getTime();
		this._C();
		e.preventDefault();
//		out('E:'+this._t+'.'+this._o);
	},
	_F:function(){		// flash
		this._d.offsetWidth=this._d.offsetWidth;
	},
	_K:function(){		// skip transition
		var n=this._d.lastChild;
		n.previousSibling.style.webkitTransition=
		n.style.webkitTransition=null;
		this._T();
	},
	_L:function(force){		// load
		var o=this,x=new XMLHttpRequest(),z=force?0:o._r[0].k;
		x.timeout=10000;
		x.onreadystatechange=function(e){
			if(x.readyState==4){
				if(x.status==200){
					var r=JSON.parse(x.responseText);
					if(r[0].k>z){
						localStorage.setItem(o._g,JSON.stringify(r));
						o._r=r;
					}
				}
				o._q=o._r.length;
				o.reset();
			}
		}
		x.open('GET',o._d.getAttribute('cells')+'?k='+z,true);
		x.send();
	},
	_M:function(e){		// touchmove
		this._t=new Date().getTime();
		switch(this._o){
		case 1:
		case 2:
		case 3:
		case 4:
		case 5:
			var c=this._d.lastChild;
			var b=c.previousSibling;
			var x=this._b-e.touches[0].screenX;
			b.style.webkitTransition=
			c.style.webkitTransition=null;
			if(x>0){
				if(this._p<this._q-1)
					this._o=4;
				else{
					this._o=2;
					x/=2;
				}
				b.style.webkitTransform='translateX(-'+x+'px)';
				c.style.webkitTransform=this._s;
			}
			else{
				if(this._p>0)
					this._o=5;
				else{
					this._o=3;
					x/=2;
				}
				b.style.webkitTransform=null;
				c.style.webkitTransform='translateX(-'+(this._w+x)+'px)';
			}
		}
		e.preventDefault();
//		out('M:'+this._t+'.'+this._o);
	},
	_S:function(e){		// touchstart
		this._t=new Date().getTime();
		switch(this._o){
		case 6:
		case 7:
		case 8:
		case 9:
			this._K();
		case 0:
			this._b=e.touches[0].screenX;
			this._o=1;
		}
//		out('S:'+this._t+'.'+this._o);
	},
	_T:function(){		// transend
//		out('T:'+new Date().getTime()+'.'+this._o+'-'+this._p+'/'+this._q);
		var m=this._d.firstChild,n=this._d.lastChild;
		n.style.webkitTransition=null;
		n.previousSibling.style.webkitTransition=null;
		switch(this._o){
		case 6:
			this._d.removeChild(n);
			this._d.insertBefore(n,m);
			n.style.webkitTransform=null;
			this._p++;
			n.src=this._p<this._q-2?this._r[this._p+2]._:'/img/blank.gif';
			break;
		case 7:
			this._d.removeChild(m);
			this._d.appendChild(m);
			m.style.webkitTransform=this._s;
			this._p--;
			m.src=this._p>0?this._r[this._p-1]._:'/img/blank.gif';
		}
		this.onchange(this._r[this._p])
		this._F();
		this._o=0;
	},
}